home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-10 | 2.6 KB | 85 lines | [TEXT/PJMM] |
- unit DemoList_Window;
-
- {File name: DemoList_Window}
- {Function: Handle a Window}
- {History: 6/3/92 Original by Prototyper. }
-
- interface
- uses
- vListMngr, vListDemo_Globals;
-
- {Initialize us so all our routines can be activated}
- procedure Init_DemoList_Window;
-
- {Open our window and draw everything}
- procedure Open_DemoList_Window;
-
- {Update our window, someone uncovered a part of us}
- procedure Update_DemoList_Window (whichWindow: WindowPtr);
-
- {Close our window}
- procedure Close_DemoList_Window (whichWindow: WindowPtr);
-
- implementation
- var
- MyWindow: WindowPtr; {Window pointer}
- tempRect, temp2Rect: Rect; {Temporary rectangle}
- Index: Integer; {For looping}
-
-
- {Initialize us so all our routines can be activated}
- procedure Init_DemoList_Window;
- begin {Start of Window initialize routine}
- MyWindow := nil; {Make sure other routines know we are not valid yet}
- end; {End of procedure}
-
-
- {Update our window, someone uncovered a part of us}
- procedure Update_DemoList_Window (whichWindow: WindowPtr);
- var
- SavePort: WindowPtr;
- begin
- if (MyWindow <> nil) and (MyWindow = whichWindow) then{Handle an open when already opened}
- begin
- GetPort(SavePort);
- SetPort(MyWindow);
- vlUpdate(MyWindow^.visRgn, DemoList);
- DrawControls(MyWindow); {Draw all the controls}
- SetPort(SavePort); {Restore the old port}
- DrawGrowIcon(MyWindow); {Draw the grow Icon again}
- end; {End for if (MyWindow<>nil)}
- end;
-
-
- {Open our window and draw everything}
- procedure Open_DemoList_Window;
- begin
- if (MyWindow = nil) then {Handle an open when already opened}
- begin
- SetRect(tempRect, 0, 0, 400, 300);
- OffsetRect(tempRect, 10, 45);
- MyWindow := NewWindow(nil, tempRect, 'vList Demo', TRUE, documentProc, WindowPtr(-1), TRUE, 0);
- DemoListWindow := MyWindow;
- SetPort(MyWindow); {Prepare to write into our window}
- {Set the default application font}
- TextFont(3); {geneva}
- TextSize(9);
- TextFace([]);
- ShowWindow(MyWindow); {Show the window now}
- SelectWindow(MyWindow); {Bring our window to the front}
- end {if (MyWindow = nil)}
- else
- SelectWindow(MyWindow); {Already open, so show it}
- end; {procedure Open_DemoList_Window}
-
- procedure Close_DemoList_Window (whichWindow: WindowPtr);
- begin {Start of Window close routine}
- if (MyWindow <> nil) and ((MyWindow = whichWindow) or (ord4(whichWindow) = -1)) then{See if we should close this window}
- begin
- DisposeWindow(MyWindow); {Clear window and controls}
- MyWindow := nil; {Make sure other routines know we are open}
- end;
- end; {procedure Close_DemoList_Window}
-
-
- end.